{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "D:\\Anaconda3\\envs\\grad\\lib\\site-packages\\ipykernel\\parentpoller.py:113: UserWarning: Parent poll failed.  If the frontend dies,\n",
      "                the kernel may be left running.  Please let us know\n",
      "                about your system (bitness, Python, etc.) at\n",
      "                ipython-dev@scipy.org\n",
      "  ipython-dev@scipy.org\"\"\")\n"
     ]
    },
    {
     "ename": "SyntaxError",
     "evalue": "invalid syntax (<ipython-input-1-95c8e8a526fc>, line 1)",
     "output_type": "error",
     "traceback": [
      "\u001B[1;36m  File \u001B[1;32m\"<ipython-input-1-95c8e8a526fc>\"\u001B[1;36m, line \u001B[1;32m1\u001B[0m\n\u001B[1;33m    CUDA_VISIBLE_DEVICES=\"1\"  python deepfault.py --params_set \"GTSRB\" \"VGG16\" --model \"VGG16\" --data \"GTSRB\"\u001B[0m\n\u001B[1;37m                                   ^\u001B[0m\n\u001B[1;31mSyntaxError\u001B[0m\u001B[1;31m:\u001B[0m invalid syntax\n"
     ]
    }
   ],
   "source": [
    "CUDA_VISIBLE_DEVICES=\"0\"  python deepfault.py --params_set \"GTSRB\" \"VGG16\" --model \"VGG16\" --data \"GTSRB\"\n",
    "CUDA_VISIBLE_DEVICES=\"3\"  python deepfault.py --params_set \"GTSRB\" \"ResNet50\" --model \"ResNet50\" --data \"GTSRB\"\n",
    "CUDA_VISIBLE_DEVICES=\"0\"  python deepfault.py --params_set \"GTSRB\" \"DenseNet121\" --model \"DenseNet121\" --data \"GTSRB\"\n",
    "CUDA_VISIBLE_DEVICES=\"0\"  python deepfault.py --params_set \"BIT\" \"VGG16\" --model \"VGG16\" --data \"BIT\"\n",
    "CUDA_VISIBLE_DEVICES=\"3\"  python deepfault.py --params_set \"BIT\" \"ResNet50\" --model \"ResNet50\" --data \"BIT\"\n",
    "CUDA_VISIBLE_DEVICES=\"1\"  python deepfault.py --params_set \"BIT\" \"DenseNet121\" --model \"DenseNet121\" --data \"BIT\"\n",
    "CUDA_VISIBLE_DEVICES=\"0\"  python deepfault.py --params_set \"Car\" \"VGG16\" --model \"VGG16\" --data \"Car\"\n",
    "CUDA_VISIBLE_DEVICES=\"3\"  python deepfault.py --params_set \"ResNet50\" \"Car\" --model \"ResNet50\" --data \"Car\"\n",
    "CUDA_VISIBLE_DEVICES=\"0\"  python deepfault.py --params_set \"DenseNet121\" \"Car\" --model \"DenseNet121\" --data \"Car\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "CUDA_VISIBLE_DEVICES=\"0\"  python mutant.py --params_set \"GTSRB\" \"VGG16\" --model \"VGG16\" --data \"GTSRB\"\n",
    "CUDA_VISIBLE_DEVICES=\"1\"  python mutant.py --params_set \"GTSRB\" \"ResNet50\" --model \"ResNet50\" --data \"GTSRB\"\n",
    "CUDA_VISIBLE_DEVICES=\"2\"  python mutant.py --params_set \"GTSRB\" \"DenseNet121\" --model \"DenseNet121\" --data \"GTSRB\"\n",
    "CUDA_VISIBLE_DEVICES=\"3\"  python mutant.py --params_set \"BIT\" \"VGG16\" --model \"VGG16\" --data \"BIT\"\n",
    "CUDA_VISIBLE_DEVICES=\"3\"  python mutant.py --params_set \"BIT\" \"ResNet50\" --model \"ResNet50\" --data \"BIT\"\n",
    "CUDA_VISIBLE_DEVICES=\"0\"  python mutant.py --params_set \"BIT\" \"DenseNet121\" --model \"DenseNet121\" --data \"BIT\"\n",
    "CUDA_VISIBLE_DEVICES=\"1\"  python mutant.py --params_set \"VGG16\" \"Car\" --model \"VGG16\" --data \"Car\"\n",
    "CUDA_VISIBLE_DEVICES=\"2\"  python mutant.py --params_set \"ResNet50\" \"Car\" --model \"ResNet50\" --data \"Car\"\n",
    "CUDA_VISIBLE_DEVICES=\"2\"  python mutant.py --params_set \"DenseNet121\" \"Car\" --model \"DenseNet121\" --data \"Car\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [
    "CUDA_VISIBLE_DEVICES=\"0\"  python mutant_random.py --params_set \"GTSRB\" \"VGG16\" --model \"VGG16\" --data \"GTSRB\"\n",
    "CUDA_VISIBLE_DEVICES=\"1\"  python mutant_random.py --params_set \"GTSRB\" \"ResNet50\" --model \"ResNet50\" --data \"GTSRB\"\n",
    "CUDA_VISIBLE_DEVICES=\"2\"  python mutant_random.py --params_set \"GTSRB\" \"DenseNet121\" --model \"DenseNet121\" --data \"GTSRB\"\n",
    "CUDA_VISIBLE_DEVICES=\"0\"  python mutant_random.py --params_set \"BIT\" \"VGG16\" --model \"VGG16\" --data \"BIT\"\n",
    "CUDA_VISIBLE_DEVICES=\"1\"  python mutant_random.py --params_set \"BIT\" \"ResNet50\" --model \"ResNet50\" --data \"BIT\"\n",
    "CUDA_VISIBLE_DEVICES=\"-1\"  python mutant_random.py --params_set \"BIT\" \"DenseNet121\" --model \"DenseNet121\" --data \"BIT\"\n",
    "CUDA_VISIBLE_DEVICES=\"0\"  python mutant_random.py --params_set \"VGG16\" \"Car\" --model \"VGG16\" --data \"Car\"\n",
    "CUDA_VISIBLE_DEVICES=\"3\"  python mutant_random.py --params_set \"ResNet50\" \"Car\" --model \"ResNet50\" --data \"Car\"\n",
    "CUDA_VISIBLE_DEVICES=\"1\"  python mutant_random.py --params_set \"DenseNet121\" \"Car\" --model \"DenseNet121\" --data \"Car\""
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "CUDA_VISIBLE_DEVICES=\"0\"  python deeptest_guided.py --params_set \"GTSRB\" \"VGG16\" --model \"VGG16\" --data \"GTSRB\"\n",
    "CUDA_VISIBLE_DEVICES=\"2\"  python deeptest_guided.py --params_set \"GTSRB\" \"ResNet50\" --model \"ResNet50\" --data \"GTSRB\"\n",
    "CUDA_VISIBLE_DEVICES=\"0\"  python deeptest_guided.py --params_set \"GTSRB\" \"DenseNet121\" --model \"DenseNet121\" --data \"GTSRB\"\n",
    "CUDA_VISIBLE_DEVICES=\"1\"  python deeptest_guided.py --params_set \"BIT\" \"VGG16\" --model \"VGG16\" --data \"BIT\"\n",
    "CUDA_VISIBLE_DEVICES=\"1\"  python deeptest_guided.py --params_set \"BIT\" \"ResNet50\" --model \"ResNet50\" --data \"BIT\"\n",
    "CUDA_VISIBLE_DEVICES=\"2\"  python deeptest_guided.py --params_set \"BIT\" \"DenseNet121\" --model \"DenseNet121\" --data \"BIT\"\n",
    "CUDA_VISIBLE_DEVICES=\"2\"  python deeptest_guided.py --params_set \"VGG16\" \"Car\" --model \"VGG16\" --data \"Car\"\n",
    "CUDA_VISIBLE_DEVICES=\"1\"  python deeptest_guided.py --params_set \"ResNet50\" \"Car\" --model \"ResNet50\" --data \"Car\"\n",
    "CUDA_VISIBLE_DEVICES=\"2\"  python deeptest_guided.py --params_set \"DenseNet121\" \"Car\" --model \"DenseNet121\" --data \"Car\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "CUDA_VISIBLE_DEVICES=\"0\"  python run_experiment.py --params_set \"GTSRB\" \"VGG16\" \"mcts\" \"tfc\" --model \"VGG16\" --dataset \"GTSRB\"  --coverage \"mutation\" --random_seed 1\n",
    "CUDA_VISIBLE_DEVICES=\"0\"  python run_experiment.py --params_set \"GTSRB\" \"ResNet50\" \"mcts\" \"tfc\" --model \"ResNet50\" --dataset \"GTSRB\"  --coverage \"mutation\" --random_seed 1\n",
    "CUDA_VISIBLE_DEVICES=\"0\"  python run_experiment.py --params_set \"GTSRB\" \"DenseNet121\" \"mcts\" \"tfc\" --model \"DenseNet121\" --dataset \"GTSRB\"  --coverage \"mutation\" --random_seed 1\n",
    "CUDA_VISIBLE_DEVICES=\"1\"  python run_experiment.py --params_set \"BIT\" \"VGG16\" \"mcts\" \"tfc\" --model \"VGG16\" --dataset \"BIT\"  --coverage \"mutation\" --random_seed 1\n",
    "CUDA_VISIBLE_DEVICES=\"1\"  python run_experiment.py --params_set \"BIT\" \"ResNet50\" \"mcts\" \"tfc\" --model \"ResNet50\" --dataset \"BIT\"  --coverage \"mutation\" --random_seed 1\n",
    "CUDA_VISIBLE_DEVICES=\"2\"  python run_experiment.py --params_set \"BIT\" \"DenseNet121\" \"mcts\" \"tfc\" --model \"DenseNet121\" --dataset \"BIT\"  --coverage \"mutation\" --random_seed 1\n",
    "CUDA_VISIBLE_DEVICES=\"2\"  python run_experiment.py --params_set \"VGG16\" \"Car\" \"mcts\" \"tfc\" --model \"VGG16\" --dataset \"Car\"  --coverage \"neuron\" --random_seed 1\n",
    "CUDA_VISIBLE_DEVICES=\"2\"  python run_experiment.py --params_set \"ResNet50\" \"Car\" \"mcts\" \"tfc\" --model \"ResNet50\" --dataset \"Car\"  --coverage \"mutation\" --random_seed 1\n",
    "CUDA_VISIBLE_DEVICES=\"2\"  python run_experiment.py --params_set \"DenseNet121\" \"Car\" \"mcts\" \"tfc\" --model \"DenseNet121\" --dataset \"Car\"  --coverage \"mutation\" --random_seed 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "CUDA_VISIBLE_DEVICES=\"-1\"  python evaluate.py --params_set \"GTSRB\" \"VGG16\" --model \"VGG16\" --data \"GTSRB\"\n",
    "CUDA_VISIBLE_DEVICES=\"-1\"  python evaluate.py --params_set \"GTSRB\" \"ResNet50\" --model \"ResNet50\" --data \"GTSRB\"\n",
    "CUDA_VISIBLE_DEVICES=\"-1\"  python evaluate.py --params_set \"GTSRB\" \"DenseNet121\" --model \"DenseNet121\" --data \"GTSRB\"\n",
    "CUDA_VISIBLE_DEVICES=\"-1\"  python evaluate.py --params_set \"BIT\" \"VGG16\" --model \"VGG16\" --data \"BIT\"\n",
    "CUDA_VISIBLE_DEVICES=\"-1\"  python evaluate.py --params_set \"BIT\" \"ResNet50\" --model \"ResNet50\" --data \"BIT\"\n",
    "CUDA_VISIBLE_DEVICES=\"-1\"  python evaluate.py --params_set \"BIT\" \"DenseNet121\" --model \"DenseNet121\" --data \"BIT\"\n",
    "CUDA_VISIBLE_DEVICES=\"-1\"  python evaluate.py --params_set \"VGG16\" \"Car\" --model \"VGG16\" --data \"Car\"\n",
    "CUDA_VISIBLE_DEVICES=\"0\"  python evaluate.py --params_set \"ResNet50\" \"Car\" --model \"ResNet50\" --data \"Car\"\n",
    "CUDA_VISIBLE_DEVICES=\"1\"  python evaluate.py --params_set \"DenseNet121\" \"Car\" --model \"DenseNet121\" --data \"Car\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "CUDA_VISIBLE_DEVICES=\"-1\"  python eva_low.py --params_set \"GTSRB\" \"VGG16\" --model \"VGG16\" --data \"GTSRB\"\n",
    "CUDA_VISIBLE_DEVICES=\"1\"  python eva_low.py --params_set \"GTSRB\" \"ResNet50\" --model \"ResNet50\" --data \"GTSRB\"\n",
    "CUDA_VISIBLE_DEVICES=\"3\"  python eva_low.py --params_set \"GTSRB\" \"DenseNet121\" --model \"DenseNet121\" --data \"GTSRB\"\n",
    "CUDA_VISIBLE_DEVICES=\"-1\"  python eva_low.py --params_set \"BIT\" \"VGG16\" --model \"VGG16\" --data \"BIT\"\n",
    "CUDA_VISIBLE_DEVICES=\"3\"  python eva_low.py --params_set \"BIT\" \"ResNet50\" --model \"ResNet50\" --data \"BIT\"\n",
    "CUDA_VISIBLE_DEVICES=\"1\"  python eva_low.py --params_set \"BIT\" \"DenseNet121\" --model \"DenseNet121\" --data \"BIT\"\n",
    "CUDA_VISIBLE_DEVICES=\"-1\"  python eva_low.py --params_set \"VGG16\" \"Car\" --model \"VGG16\" --data \"Car\"\n",
    "CUDA_VISIBLE_DEVICES=\"-1\"  python eva_low.py --params_set \"ResNet50\" \"Car\" --model \"ResNet50\" --data \"Car\"\n",
    "CUDA_VISIBLE_DEVICES=\"-1\"  python eva_low.py --params_set \"DenseNet121\" \"Car\" --model \"DenseNet121\" --data \"Car\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [
    "每类的变异模型，代表了模型对该类进行判断，影响最大的神经元。杀死他，证明我们的测试用例探测到了这个神经元。探索到这类神经元的程度越大。\n",
    "可以证明测试用例可以涉足到这些神经元。那这些神经元就会影响模型，做出错误的判断，为啥f1值反而是最高的呢。  \n",
    "如果不杀死他，证明我们的测试用例没有探测这个点。"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "grad",
   "language": "python",
   "name": "grad"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.15"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}